<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="../js/jquery-3.2.1.js"></script>
<script>
    var examplearr = [8, 94, 15, 88, 55, 76, 21, 39];
    function sortarr(arr) {
        for (i = 0; i < arr.length - 1; i++) {
            for (j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    var temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
        return arr;
    }
    sortarr(examplearr);
    console.log(examplearr);
</script>
</body>
</html>